/*
 * @Author: 李天惊 uf_lee@163.com
 * @Date: 2022-09-06 10:30:34
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2023-04-07 13:45:12
 * @FilePath: \ahbs\uc_sys\src\api\uc\userRole\index.ts
 * Copyright (c) 2022 by 李天惊 uf_lee@163.com, All Rights Reserved.
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 用户角色列表
export const ucUserRoleListAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleListAdmin',
      data: data
    }
  })
}

// 用户角色修改
export const ucUserRoleEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleEdit',
      data: data
    }
  })
}

// 用户角色新增
export const ucUserRoleAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleAdd',
      data: data
    }
  })
}

// 用户角色删除
export const ucUserRoleDelAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleDelAdmin',
      data: data
    }
  })
}

// 用户角色批量删除
export const ucUserRoleBatchDelApi = (data: { ids: string }) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleBatchDel',
      data: data
    }
  })
}

// 用户角色修改密码
export const ucUserRolePasswordApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRolePassword',
      data: data
    }
  })
}

// 用户角色设置(批量设置)
export const ucUserRoleSetAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucUserRoleSetAdmin',
      data: data
    }
  })
}
